Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded an optional Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/modules/settings/AuthenticationTab.tsx (1)
148-157:⚠️ Potential issue | 🟡 MinorInclude Local MFA state in post-save
updateRefbaseline.
isLocalMFAEnabledis tracked inhasChanges(Line 118) but not reset inupdateRefafter save, so the form can stay dirty after a successful save.💡 Suggested fix
updateRef([ peerApproval, userApprovalRequired, loginExpiration, expiresIn, expireInterval, peerInactivityExpirationEnabled, peerInactivityExpiresIn, peerInactivityExpireInterval, + isLocalMFAEnabled, ]);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/modules/settings/AuthenticationTab.tsx` around lines 148 - 157, The post-save baseline update (the call to updateRef in AuthenticationTab) omits the isLocalMFAEnabled flag, so hasChanges remains true after saving; update the array passed to updateRef (the one containing peerApproval, userApprovalRequired, loginExpiration, expiresIn, expireInterval, peerInactivityExpirationEnabled, peerInactivityExpiresIn, peerInactivityExpireInterval) to also include isLocalMFAEnabled so that the local MFA state is reset and the form is no longer dirty after a successful save.
🧹 Nitpick comments (1)
src/modules/settings/AuthenticationTab.tsx (1)
70-70: Update stale implementation comment.Line 70 says this is "UI only, not wired to the backend yet", but Line 143 already persists
local_mfa_enabledin the save payload.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/modules/settings/AuthenticationTab.tsx` at line 70, The comment "// Local MFA (UI only, not wired to the backend yet)" in AuthenticationTab is stale—update it to reflect that local MFA is persisted (local_mfa_enabled is included in the save payload). Find the AuthenticationTab component and replace or reword that comment to indicate the local MFA setting is persisted to the backend (referencing local_mfa_enabled and the save/update logic that sends the payload), or remove the misleading comment entirely so it no longer claims the feature is UI-only.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/modules/settings/AuthenticationTab.tsx`:
- Around line 228-252: The visibility condition is inverted: change the ternary
so the Local MFA FancyToggleSwitch is shown only when local auth is enabled and
embedded IDP is enabled; replace the current condition
(account.settings.local_auth_disabled || !account.settings.embedded_idp_enabled)
with (!account.settings.local_auth_disabled &&
account.settings.embedded_idp_enabled) so the FancyToggleSwitch
(isLocalMFAEnabled, setIsLocalMFAEnabled, permission.settings.update) matches
the gating pattern used in UsersTable.tsx.
---
Outside diff comments:
In `@src/modules/settings/AuthenticationTab.tsx`:
- Around line 148-157: The post-save baseline update (the call to updateRef in
AuthenticationTab) omits the isLocalMFAEnabled flag, so hasChanges remains true
after saving; update the array passed to updateRef (the one containing
peerApproval, userApprovalRequired, loginExpiration, expiresIn, expireInterval,
peerInactivityExpirationEnabled, peerInactivityExpiresIn,
peerInactivityExpireInterval) to also include isLocalMFAEnabled so that the
local MFA state is reset and the form is no longer dirty after a successful
save.
---
Nitpick comments:
In `@src/modules/settings/AuthenticationTab.tsx`:
- Line 70: The comment "// Local MFA (UI only, not wired to the backend yet)" in
AuthenticationTab is stale—update it to reflect that local MFA is persisted
(local_mfa_enabled is included in the save payload). Find the AuthenticationTab
component and replace or reword that comment to indicate the local MFA setting
is persisted to the backend (referencing local_mfa_enabled and the save/update
logic that sends the payload), or remove the misleading comment entirely so it
no longer claims the feature is UI-only.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 786492e7-d865-4283-8542-f62e3c72f085
📒 Files selected for processing (2)
src/interfaces/Account.tssrc/modules/settings/AuthenticationTab.tsx
Matching PR for feature netbirdio/netbird#5804
Allows admins to enable/disable MFA for local users
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
netbirdio/docs#704
Summary by CodeRabbit